// 生成随机验证码
function generateVerificationCode(length = 6) {
  const digits = '0123456789';
  let code = '';
  for (let i = 0; i < length; i++) {
    code += digits[Math.floor(Math.random() * digits.length)];
  }
  return code;
}

// 格式化手机号码
function formatPhoneNumber(phone: string) {
  return phone.replace(/\D/g, '');
}

function addMinutes(date: Date, minutes: number) {
  return new Date(date.getTime() + minutes * 60 * 1000);
}
export {
  generateVerificationCode,
  addMinutes,
  formatPhoneNumber
};
